package com.shy.condition_db;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class OracleCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        boolean ret;

        try {
            context.getClassLoader().loadClass("oracle.jdbc.driver.OracleConnection");
            ret = true;
        } catch (ClassNotFoundException e) {
            ret = false;
        }

        return ret;
    }
}
